﻿#ifndef ALGWORKER_H
#define ALGWORKER_H
#include "Common/common.h"
#include <QObject>
#include "Alg/measure_size.h"
#include "Alg/measure_cricle.h"
#include "Alg/Defect.h"
#include "Alg/display.h"

#include "vector"
class AlgWorker : public QObject
{
    Q_OBJECT
public:
    explicit AlgWorker(QObject *parent = nullptr);
    ~AlgWorker();

    Measure_Cricle m_AlgCricle;
    Measure_Size m_AlgSize;
    Display display;
    Defect m_AlgDefect;

    Cam1 m_cCam1;
    Cam2 m_cCam2;
    CCD_34_PARAME m_cCam3;
    CCD_34_PARAME m_cCam4;

    HTuple In_Round;
    HTuple Out_Round;
    HTuple In_Len;
    HTuple Out_Len;
    HTuple Distance;
    HTuple Len;
    int m_nNGorOK[100];
    int m_nResult;

    //csv 数据
    float fIn_Round[100];
    float fOut_Round[100];
    float fIn_Len[100];
    float fOut_Len[100];
    float fLen[100];

    int m_nModel = 0; // 0 自动模式 1 手动模式 不计算数据
    int m_nSaveImage = 0; // 0 不处理  1 修改参数不存图


    bool m_bSaveImage = false;  // fasle 1 2相机不存图

    int nSave = 0; //0 不存  1存图
    int nDelete = 0;
    AlgPlace m_algPlaceA;
    AlgPlace m_algPlaceB;

    int m_nNum = 0;
signals:
    void sigCameraResult(int m_nResult);


    void sigSaveImgStart(CameraData m_cImageInfo);
public slots :
    void Initialize();
    void start(CameraData m_cImageInfo);
private:
    void show(HObject img, HTuple hv_WindowHandle,int index);
};

#endif // ALGWORKER_H
